<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>.: EDIT DATA :.</title>
<!-- Memanggil file layout.css -->
<script language="javascript" src="calendar/calendar.js"></script>

</head>

<body>
<?php 
require_once('calendar/classes/tc_calendar.php');
include "konek.php"; // untuk memanggil koneksi
$empno=$_GET['nik'];
$PeritahSql="SELECT EMP.*,DEPT.DNAME FROM EMP,DEPT where EMP.DEPTNO=DEPT.DEPTNO AND EMPNO='$empno'"; 
//untuk mempercepat proses query field harus di sebutkan
//dengan sintak diatas akan memanggil semua field yang ada di table EMP
$Query = oci_parse($koneksi,$PeritahSql); 
oci_execute($Query);
oci_fetch_array($Query);
?>

<form id="form1" name="form1" method="post" action="proses_edtdata.php">
<table width="100%" border="0">
  <tr>
    <td>&nbsp;</td>
    <td width="17%">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td width="36%">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="17%">&nbsp;</td>
    <td colspan="3"><strong>FORM EDIT DATA</strong></td>
    <td width="45%">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>EMP ID</td>
    <td>
</td>
    <td><label>
      <input name="empno" type="text" id="empno" value="<?php echo ociresult($Query,"SDM") ?>" size="20" readonly="readonly" />
    </label></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>EMP NAME</td>
    <td>&nbsp;</td>
    <td><input name="empname" type="text" id="empname" value="<?php echo ociresult($Query,"NAMA_KARYAWAN") ?>" size="60" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>JOB</td>
    <td>&nbsp;</td>
    <td><input name="job" type="text" id="job" value="<?php echo ociresult($Query,"NAMA_JABATAN") ?>" size="60" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>JOB</td>
    <td>&nbsp;</td>
    <td><input name="job" type="text" id="job" value="<?php echo ociresult($Query,"NAMA_DIVISI") ?>" size="60" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>HIRE DATE</td>
    <td>&nbsp;</td>
    <td><?php
					  $date1_default=ociresult($Query,"UPDATE_DATE");
					  $myCalendar = new tc_calendar("date", true);
					  $myCalendar->setIcon("calendar/images/iconCalendar.gif");
					  $myCalendar->setDate(date('d', strtotime($date1_default))
           			 , date('m', strtotime($date1_default))
            		 , date('Y', strtotime($date1_default)));
					  $myCalendar->setPath("calendar/");
					  $myCalendar->setYearInterval(1960, 2015);
					  $myCalendar->writeScript();
					  ?></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>SALARY</td>
    <td>&nbsp;</td>
    <td><input type="text" name="salary" id="salary" value="<?php echo ociresult($Query,"NAMA_GEDUNG") ?>" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>DEPT</td>
    <td>&nbsp;</td>
    <td><label>
    <select name="dept" id="dept">
    <?php
	echo "<option value=".ociresult($Query,"DEPTNO").">".ociresult($Query,"DNAME")."</option>";
    $PeritahSql1="SELECT * FROM DEPT";
	$Query1 = oci_parse($koneksi,$PeritahSql1); 
	oci_execute($Query1);
	while (oci_fetch_array($Query1)){
	echo "<option value=".ociresult($Query1,"DEPTNO").">".ociresult($Query1,"DNAME")."</option>";
	}
	?>
    </select>
    </label></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><label>
      <input type="submit" name="simpan" id="simpan" value="Save" />
    </label></td>
    <td>&nbsp;</td>
  </tr>
</table>
    </form>
</body>
</html>